import BlankLayout from '@/layouts/BlankLayout'
import { BasicLayout } from '.'

export const asyncRoutes = [
  {
    path: '/welcome',
    name: 'Welcome',
    component: () => import('@/views/Welcome.vue'),
    meta: { title: '欢迎', icon: 'smile', affix: true }
  },
  {
    path: '/table-list',
    name: 'TableList',
    component: () => import('@/views/TableList/table.vue'),
    meta: { title: 'TableList', icon: 'table' }
  },
  {
    path: '/demo',
    name: 'Demo',
    component: BlankLayout,
    meta: { title: 'Demo', icon: '#demo'}, // 自定义图标
    children: [
      {
        path: 'container-query',
        name: 'DemoContainerQuery',
        component: () => import('@/views/Demo/container-query.vue'),
        meta: { title: 'ContainerQuery 容器查询', noCache: true }
      },
      {
        path: 'pro-card',
        name: 'DemoProCard',
        component: () => import('@/views/Demo/pro-card.vue'),
        meta: { title: 'ProCard 卡片', noCache: true }
      },
      {
        path: 'pro-form',
        name: 'DemoProForm',
        component: () => import('@/views/Demo/pro-form.vue'),
        meta: { title: 'ProForm 表单', noCache: true }
      }
    ]
  }
]

export default [
  {
    path: '/',
    name: 'root',
    component: BasicLayout,
    redirect: asyncRoutes[0].path, // 如果设置此项，需要配置 GlobalTabs/Tabs.vueL177，防止重复跳转
    children: asyncRoutes
  }
]
